Accusoft.ImagXpress13.ActiveX
Remove Redeye

To reduce the red reflection of the flash seen in the eyes of people in color flash photo images, use one of the following methods:

Manual Red Eye Removal

Manually remove redeye from eyes in the image, using the RemoveRedeye method. 

You must define an area to be processed, using the Area method prior to using the RemoveRedeye method.

Automatic Red Eye Removal

Automatically remove redeye from eyes in the image, using the AutoRemoveRedeye method. The AutoRemoveRedeye method will accurately correct red eyes without modifying elements in the photo which are not eyes, in most cases without any intervention.  

Optimized Red Eye Removal

As with any algorithm, there is a potential for false positives (modifications of areas that are not eyes), or red eyes that are not corrected in some images.

To provide the application with maximum control over this behavior, the AutoRemoveRedeye method returns all areas that have been corrected as a collection of rectangles. The rectangles identify areas in which red-eyes were detected and corrected and a value indicating the confidence that the area corrected was a red eye. This enables the application to set an acceptable level of false positives and optimize red-eye correction.  

The following describes how to implement optimized Red Eye Removal:

Enable the undo method by setting UndoEnabled = True. 

Correct redeye, by calling AutoRemoveRedeye, specifying desired eyeshade, desired eye glare and setting UseEditRectangles to False. (When bUseEditRectangles is True, previously detected rectangles will be used to correct red eyes. When bUseEditRectangles is False, existing rectangles are ignored.) The AutoRemoveRedeye method removes red eyes from the image and sets the rectangles property to the collection of rectangles in which red eyes were detected and corrected.

To correct redeye without displaying the results, disable paint by setting AutoInvalidate = False prior to calling AutoRemoveRedeye.

Search and reverse any false positives

A. Enumerate through the set of rectangles:

  1. Identify the number of rectangles found by calling RedeyeTotalCount.  This sets the current rectangle to look at using the RedeyeRectangle properties.
  2. Examine the RedeyeRectangleConfidence indicating the confidence value of that redeye correction.

B. Determine if a rectangle erroneously identified an area as containing red eyes, either by visual inspection or by determining that confidence values are below the desired threshold.

This threshold could be set by either the application end-user or the application programmer.

Add red eyes that were not automatically corrected, if any, as follows:

  1. Identify any remaining red eyes (visually).
  2. Draw a rectangle around the remaining eyes. (Use rubberband, region, or area.)
  3. Add the rectangle to the rectangle collection, by calling RedeyeRectangleAdd

Modify redeye regions size or position, by calling RedeyeRectangleEdit

Correct red-eyes and display the image as follows:

  1. Undo the previous AutoRemoveRedeye by calling Undo.
  2. Enable painting, by setting AutoInvalidate = True
  3. Correct redeye, by calling AutoRemoveRedeye, setting bUseEditRectangles to True.
See Also

 

 


©2019. Accusoft Corporation. All Rights Reserved.

Send Feedback